<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>增加学科</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入Font Awesome图标库 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        :root {
            --primary-color: #2563eb;
            --primary-light: #3b82f6;
            --primary-dark: #1d4ed8;
            --success-color: #10b981;
            --danger-color: #ef4444;
            --warning-color: #f59e0b;
            --text-color: #1e293b;
            --text-light: #64748b;
            --border-color: #e2e8f0;
            --bg-color: #f8fafc;
            --card-bg: #ffffff;
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
            --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
            --radius-sm: 4px;
            --radius-md: 6px;
            --radius-lg: 8px;
            --transition: all 0.3s ease;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.6;
            padding: 20px;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            background-color: var(--card-bg);
            border-radius: var(--radius-lg);
            box-shadow: var(--shadow-md);
            padding: 30px;
            margin-top: 30px;
        }

        .page-header {
            margin-bottom: 30px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border-color);
        }

        .page-title {
            font-size: 24px;
            font-weight: 600;
            color: var(--text-color);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .page-title i {
            color: var(--primary-color);
        }

        .form-description {
            color: var(--text-light);
            margin-top: 8px;
            font-size: 14px;
        }

        .form-container {
            margin-top: 20px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: var(--text-color);
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .form-label i {
            color: var(--primary-color);
            font-size: 14px;
        }

        .form-control {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            font-size: 15px;
            transition: var(--transition);
            background-color: white;
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .form-control::placeholder {
            color: #94a3b8;
            font-size: 14px;
        }

        textarea.form-control {
            min-height: 120px;
            resize: vertical;
            line-height: 1.5;
        }

        .form-hint {
            margin-top: 5px;
            font-size: 12px;
            color: var(--text-light);
        }

        .btn-group {
            margin-top: 30px;
            display: flex;
            gap: 15px;
            justify-content: flex-end;
        }

        .btn {
            padding: 10px 20px;
            border-radius: var(--radius-md);
            font-weight: 500;
            font-size: 14px;
            cursor: pointer;
            transition: var(--transition);
            border: none;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background-color: var(--primary-dark);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
        }

        .btn-secondary {
            background-color: #f1f5f9;
            color: var(--text-color);
        }

        .btn-secondary:hover {
            background-color: #e2e8f0;
            transform: translateY(-2px);
        }

        .required-mark {
            color: var(--danger-color);
            font-size: 14px;
        }

        .form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 15px;
            margin-top: 30px;
            padding-top: 20px;
            border-top: 1px solid var(--border-color);
        }

        @media (max-width: 768px) {
            .container {
                padding: 20px;
                margin-top: 15px;
            }

            .btn-group {
                flex-direction: column;
            }

            .btn {
                width: 100%;
                justify-content: center;
            }
        }
    </style>
</head>
<body>
<div class="container">
    <div class="page-header">
        <h1 class="page-title">
            <i class="fas fa-plus-circle"></i>增加学科
        </h1>
        <p class="form-description">请填写学科相关信息，带 <span class="required-mark">*</span> 的为必填项</p>
    </div>

    <form action="add" method="post" class="form-container">
        <div class="form-group">
            <label class="form-label">
                <i class="fas fa-book"></i>学科名字 <span class="required-mark">*</span>
            </label>
            <input type="text" name="gname" class="form-control" placeholder="请输入学科名称" required>
            <p class="form-hint">例如：高等数学、人工智能基础、Java编程入门</p>
        </div>

        <div class="form-group">
            <label class="form-label">
                <i class="fas fa-tags"></i>类型 <span class="required-mark">*</span>
            </label>
            <input type="text" name="type" class="form-control" placeholder="请输入学科类型" required>
            <p class="form-hint">例如：理科、工科、计算机科学、文学</p>
        </div>

        <div class="form-group">
            <label class="form-label">
                <i class="fas fa-user"></i>作者 <span class="required-mark">*</span>
            </label>
            <input type="text" name="author" class="form-control" value="${goods.author}" placeholder="请输入作者/讲师姓名" required>
            <p class="form-hint">请输入真实姓名或机构名称</p>
        </div>

        <div class="form-group">
            <label class="form-label">
                <i class="fas fa-money-bill-wave"></i>价格 <span class="required-mark">*</span>
            </label>
            <input type="text" name="price" class="form-control" placeholder="请输入价格" required>
            <p class="form-hint">请输入数字，例如：99.00 或 199</p>
        </div>

        <div class="form-group">
            <label class="form-label">
                <i class="fas fa-image"></i>图片
            </label>
            <input type="text" name="img" class="form-control" placeholder="请输入图片URL地址">
            <p class="form-hint">支持JPG、PNG格式，建议尺寸：400x300像素</p>
        </div>

        <div class="form-group">
            <label class="form-label">
                <i class="fas fa-video"></i>视频链接
            </label>
            <input type="text" name="video" class="form-control" placeholder="请输入视频播放地址">
            <p class="form-hint">支持YouTube、B站、腾讯视频等平台的嵌入链接</p>
        </div>

        <div class="form-group">
            <label class="form-label">
                <i class="fas fa-clock"></i>时长
            </label>
            <input type="text" name="duration" class="form-control" placeholder="请输入视频时长">
            <p class="form-hint">例如：45:30（分钟:秒）或 01:30:25（小时:分钟:秒）</p>
        </div>

        <div class="form-group">
            <label class="form-label">
                <i class="fas fa-align-left"></i>描述
            </label>
            <textarea name="describe1" class="form-control" placeholder="请输入学科详细描述"></textarea>
            <p class="form-hint">可以描述学科内容、适合人群、学习目标等信息</p>
        </div>

        <div class="form-actions">
            <a href="${pageContext.request.contextPath}/goods" class="btn btn-secondary">
                <i class="fas fa-arrow-left"></i>返回列表
            </a>
            <button type="submit" class="btn btn-primary">
                <i class="fas fa-save"></i>提交
            </button>
        </div>
    </form>
</div>
</body>
</html>